From f88b777fe5bf4b6e3e14c88c7cdd673b66c13745 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Fri, 9 Sep 2022 17:02:59 +0200 Subject: [PATCH] widget: Implement new GtkAccessible vfuncs --- gtk/gtkwidget.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 72582aeb6a..c842d1f7a5 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8465,11 +8465,35 @@ gtk_widget_accessible_get_platform_state (GtkAccessible *self, } } +static GtkAccessible * +gtk_widget_accessible_get_parent (GtkAccessible *self) +{ + return GTK_ACCESSIBLE (gtk_widget_get_parent (GTK_WIDGET (self))); +} + +static GtkAccessible * +gtk_widget_accessible_get_child_at_index (GtkAccessible *self, guint index) +{ + guint idx = 0; + GtkWidget *child; + for (child = gtk_widget_get_first_child (GTK_WIDGET (self)); + child != NULL; + child = gtk_widget_get_next_sibling (child)) + { + if (idx == index) + return GTK_ACCESSIBLE (child); + idx++; + } + return NULL; +} + static void gtk_widget_accessible_interface_init (GtkAccessibleInterface *iface) { iface->get_at_context = gtk_widget_accessible_get_at_context; iface->get_platform_state = gtk_widget_accessible_get_platform_state; + iface->get_parent = gtk_widget_accessible_get_parent; + iface->get_child_at_index = gtk_widget_accessible_get_child_at_index; } static void -- 2.30.2